package erp.education.server.db.implementation.user;

 

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

import erp.education.server.db.entites.user.Credentials;
import erp.education.server.db.implementation.common.BaseDAO;
import erp.education.server.db.interfaces.user.LoginDAOI;
@Component("loginDao")
public class LoginDAO extends BaseDAO implements LoginDAOI {

	@Override
	public Credentials getUser(String authenticationId) {
		// TODO Auto-generated method stub
		Credentials user=null;
		Map params=new HashMap();
		params.put("authenticationId", authenticationId);
		
		user=(Credentials)getSingleResult("select user from Credentials user where user.authenticationId=:authenticationId ", params);
	 
		 
		 
		return user;
	}
	@Override
	public Credentials updateUser(Credentials user) {
		// TODO Auto-generated method stub
	 
	 
		
		user=(Credentials)merge(user);
	 
		 
		 
		return user;
	}
}
